package org.chen;

import org.chen.DbUtil;
import org.chen.SqlRunner;

import java.sql.Connection;

/**
 * @Author czl
 * @Date 2024-04-21
 */
public class MainTest02 {
    public static void main(String[] args) {
        del();
    }

    private static void add() {
        String sql = "insert into staffs(name,age,phone,sta_pos) values (?,?,?,?)" ;
        Connection connection = DbUtil.getConnection();
        SqlRunner sqlRunner = new SqlRunner(connection) ;
        int r = sqlRunner.update(sql, "赵六", 20, "13417747371", "项目经理");
        System.out.println(r);
    }

    private static void del() {
        String sql = "delete from staffs where id=?" ;
        Connection connection = DbUtil.getConnection();
        SqlRunner sqlRunner = new SqlRunner(connection) ;
        int r = sqlRunner.update(sql, 13);
        System.out.println(r);
    }
}
